<%@ page import="cn.java79.quiz.entity.User" %>
<%@ page import="cn.java79.quiz.service.UserService" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022/8/23
  Time: 15:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%@include file="/checkLogin.jsp"%>
 <%
     request.setCharacterEncoding("utf-8");//设置字符集
     String logname=request.getParameter("loginname");
     String realname=request.getParameter("realname");
     String phone=request.getParameter("phone");
     String email=request.getParameter("email");
     String pass=request.getParameter("pass");
     Long id=Long.parseLong(request.getParameter("id"));
     int score=Integer.parseInt(request.getParameter("score"));
     User user=new User(logname,realname,email,phone,pass);
     user.setScore(score);
     user.setId(id);
     int r=UserService.ME.update(user);
     if(r>0){
         response.sendRedirect("users.jsp");
         return;
     }

 %>
<h1>修改失败，<a href="javascript:history.back()">返回</a> </h1>
</body>
</html>
